#!/bin/bash

project=$1
repo=$2

if [ $# -lt 1 ]; then
    echo "$0 <project>"
    exit 1
fi

if [ ! -d "/data/grok/opengrok/src/${project}" ]; then
    if [ -z "${repo}" ]; then
        echo "${project} not exists, must provide repo url!"
        exit 1
    fi
    cd /data/grok/opengrok/src; git clone "${repo}" "${project}"
fi
